package com.lzh.service.impl;

import com.lzh.bean.Dict;
import com.lzh.mapper.DictMapper;

import com.lzh.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
import java.util.Map;

@Service
public class DictServiceImpl implements DictService {

    @Autowired
    DictMapper dictMapper;

    /**
     * 保存字典
     * @param dict
     * @return
     */
    @Override
    public int save(Dict dict) {
        int i = dictMapper.saveDict(dict);
        return i;
    }

    /**
     * 查询字典
     * @param pid
     * @return
     */
    @Override
    public List<Map> query(int pid) {
        List<Map> query = dictMapper.query(pid);
        return query;
    }

    @Override
    public int update(Dict dict) {
        int update = dictMapper.update(dict);
        return update;
    }

    @Override
    public int delete(int id) {
        int delete = dictMapper.delete(id);
        return delete;
    }

}
